package com.jingdong.controller;



import com.jingdong.pojo.BaoGaoDetail;
import com.jingdong.pojo.GuanZhuDetail;
import com.jingdong.service.BaoGaoDetailCategoryService;
import com.jingdong.service.GuanZhuDetailCategoryService;
import com.jingdong.utils.ResultVOUtil;
import com.jingdong.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Zqm
 */
@RestController
@RequestMapping("/baogao")
public class BaoGaoDetailController {

    @Autowired
    private BaoGaoDetailCategoryService baoGaoDetailCategoryService;


    @RequestMapping("/MhQuery")
    public  ResultVO baogaodetail(@RequestParam(value = "title", required = false, defaultValue = "-1") String title){
        try {
            BaoGaoDetail baoGaoDetail=new BaoGaoDetail();
            baoGaoDetail.setTitle(title);
            Page<BaoGaoDetail> all = baoGaoDetailCategoryService.findALLByLikeTitle(1, 200, baoGaoDetail);
            ResultVO success = ResultVOUtil.succecss(all);
            return success;
        }catch (Exception e){
            return  null;
        }
    }

}
